<?php
class Operat extends CI_Controller {
	
	public function __construct() {
		parent::__construct ();
		$this->load->model ( 'operat_Mod', 'op' );
	}
	
	public function index() {
		echo site_url ();
	}
	
	public function write() {
		$this->view->display ( "opera_write" );
	}
	
	/*
	 * read operat-all-table
	 */
	public function read() {
		print_r ( $this->op->read_all () );
	}
	
	public function delete($id) {
		$this->op->delete ( $id );
	}
	
	public function updata($id) {
		$this->view->assign ( "id", $id );
		$this->view->display ( "opera_updata" );
	}
	
	public function op_updata() {
		$this->op->updata_byid ( $_POST ["id"] );
	}
	
	public function op_write() {
		$_POST ['time'] = time ();
		$_POST ['type_id'] = 1;
		$this->op->create ();
	}
	
	public function op_read_byid($id) {
		print_r ( $this->op->read_byid ( $id ) );
	}

}

?>